package com.snackshop.pojo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {
    /**
     * 响应状态码
     */
    private Integer code;
    /**
     * 数据响应提示消息
     */
    private String msg;
    /**
     * 响应的数据
     */
    private Object data;

    public static R RESULT(ResponseState state){
        return new R(state.getCode(),state.getMsg(),null);
    }

    public static R RESULT(ResponseState state,Object data){
        return new R(state.getCode(),state.getMsg(),data);
    }

}
